package com.paco.study.cloud.code.dao;

import com.paco.study.cloud.code.model.AuthCode;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

public interface AuthCodeDao extends JpaRepository<AuthCode, Integer> {

    @Query(value = "select * from  lagou_auth_code  la where la.email =:email and la.code = :code order by createtime desc limit 1"
            , nativeQuery = true)
    AuthCode findByEmailAndCode(@Param("email") String email, @Param("code") String code);
}
